<script>
    $(document).ready(function () {
        $('#nav-case').addClass("active");
        $('#side-batch').addClass("active");
        $('.filter-item-value').change(function () {
            var $this = $(this);
            if ($this.val() != '') {
                $(this).siblings('.dropdown-toggle').addClass('btn-selected');
            } else {
                $(this).siblings('.dropdown-toggle').removeClass('btn-selected');
            }
        })

        $('#select-batch').delegate('tbody tr','click',function(){
            var batch = $(this).data('name');
            var oldVal = $('#search-keywords').val();
            if(oldVal.indexOf(batch) <0) {
                $('#search-keywords').val(oldVal + batch + '\n');
            }
        });
    });
</script>